
print(all([0,-5,3,4]))#非0就是真,全为真才是true
print(all([1,-5,3,4]))
print(all([]))

print(any([0,-5,3,4]))#有一个为真，，就是true
print(any([0]))
print(any([]))  #空--->false

print(ascii([1,2,'学习']))
a =ascii([1,2,'学习'])
print(type(a),[a])

print(bin(255))#转成2进制

print(bool(0))
print(bool(1))
print(bool([1,2]))

a = bytes('abcder',encoding='utf-8')
b = bytearray('abcder',encoding='utf-8')
print(b[1])
b[1]=50
print(b)
print(a.capitalize(),a)


print(callable([])) #可不可以调用
def say():pass
print(callable(say)) #可不可以调用
print(callable(say())) #可不可以调用

print(chr(97))
print(chr(65))

print(ord('a'))
print(ord('A'))

print(divmod(5,3))
print(divmod(5,1))
print(divmod(5,2))

# eval()
# exec()将字符串变成字典

#a = frozensetset([1,2,5,4,6,62,54,2])#变成不可变集合，列表

print(globals())#获取当前变量所有的，，，，

print(hash('nadjaidj'))#无序到有序，映射关系

print(hex(155))#转成16进制，，前缀0X，，后缀H


def test():
    local_var = 333
    print(locals())#打印局部变量
    print(globals())
test()
print(globals())#打印全部变量
print(globals().get('local_var'))

print(oct(54))#转八进制
print(oct(1))#转八进制
print(oct(5))#转八进制,0o开头
print(oct(8))#转八进制

print(round(1.3315))
print(round(1.3315,2))
print(round(1.3315,3))

a = {6:2,8:0,1:4,-5:6,7:66,3:5}
print(sorted(a.items()))
print(sorted(a.items(),key=lambda  x:x[1]))
print(sorted(a))
print(a)

a = [1,2,3,4]
b = ['a','b','c','d']
for i in zip(a,b):
    print(i)

__import__("decorator")




